package com.sokal.easycare.modules.product.service.catalog;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.sokal.easycare.common.service.TreeService;
import com.sokal.easycare.common.utils.StringUtils;
import com.sokal.easycare.modules.product.entity.catalog.ProCatalog;
import com.sokal.easycare.modules.product.dao.catalog.ProCatalogDao;

/**
 * 产品目录Service
 * @author liliangdong
 * @version 2017-03-12
 */
@Service
@Transactional(readOnly = true)
public class ProCatalogService extends TreeService<ProCatalogDao, ProCatalog> {

	public ProCatalog get(String id) {
		return super.get(id);
	}
	
	public List<ProCatalog> findList(ProCatalog proCatalog) {
		if (StringUtils.isNotBlank(proCatalog.getParentIds())){
			proCatalog.setParentIds(","+proCatalog.getParentIds()+",");
		}
		return super.findList(proCatalog);
	}
	
	@Transactional(readOnly = false)
	public void save(ProCatalog proCatalog) {
		super.save(proCatalog);
	}
	
	@Transactional(readOnly = false)
	public void delete(ProCatalog proCatalog) {
		super.delete(proCatalog);
	}
	
}